package com.test.annotation;

import java.util.List;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.test.mapper.NodeMapper;
import com.test.mapper.NodeMapper2;
import com.test.mapper.NodeMapper3;
import com.test.po.Node;

public class App2 {

	public static void main(String[] args) {
        // 用我们的配置文件来启动一个 ApplicationContext
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("com.test.annotation.demo");
        System.out.println("context 启动成功");

        NodeMapper3 nodeMapper3 = context.getBean(NodeMapper3.class);
        NodeMapper2 nodeMapper2 = context.getBean(NodeMapper2.class);
        Node n1 = new Node();
        n1.setId(1l);
        List<Node> no = nodeMapper3.get(n1);
        System.out.println(no);
        nodeMapper2.update(n1);
        List<Node> no2 = nodeMapper3.get(n1);
        System.out.println(no2);
    }

}
